<?php

class m120330_112340_add_table_notification extends CDbMigration
{
	public $table = 'notification';
	
	public function up()
	{
			$this->createTable(
			$this->table,
			array(
				'id' 			=> 'pk', // primary key, Yii'll do the rest
				'description' 	=> 'text',
				'prayedby_id'		=> 'int not null', // this will tell Yii that this is a required field
				'created_at'	=> 'datetime',
				'updated_at'	=> 'datetime'
			),
			'ENGINE=InnoDB CHARACTER SET utf8' // we need InnoDB for the indexes
		);

		$this->createIndex( 'fk_notification_prayedby_id', $this->table, 'prayedby_id' );
		$this->addForeignKey('fk_notification_prayedby_id', $this->table, 'prayedby_id', 'prayedby', 'id', 'NO ACTION', 'NO ACTION');
	}

	public function down()
	{
		$this->dropTable ($this->table);
	}


}